import { instance } from "../axios";

/**
 * 获取可用商品列表
 * @returns {Promise} - 返回商品列表
 */
export const getAvailableProducts = () => {
  return instance.get('/store/products');
};

/**
 * 购买商品
 * @param {number} productId - 商品ID
 * @returns {Promise} - 返回购买结果
 */
export const purchaseProduct = (productId) => {
  return instance.post(`/store/purchase?productId=${productId}`);
};

/**
 * 获取用户订单
 * @returns {Promise} - 返回用户订单列表
 */
export const getUserOrders = () => {
  return instance.get('/store/orders');
}; 